﻿#pragma once

#include "Controller.h"

#include <boost/signal.hpp>

#include "../domain/models/CardsCollection.h"
#include "../domain/models/Player.h"
#include "../views/abstract/IBoardView.h"

namespace Controllers {

	class BoardController: public Controller
	{
		Views::IBoardView* view;
		Players::Player* player;
		Cards::RoomsCards rooms_cards;

		void changePlayerPosition();
		void setPlayerPosition(BoardItems::Room*);
		void moveToRoom(Players::Player* player, BoardItems::WeaponPiece* weapon, BoardItems::Room* room);

	public:
		boost::signal<void ()> movePerformedEvent; /**< Zdarzenie wywoływane po wykonaniu ruchu */

		/**
		* Konstruktor kontrolera ruchu
		* @param view Widok wyboru miejsca
		* @param logger Logger
		* @param player Aktualny gracz, który wykonuje ruch
		* @param cards Karty pokojów
		*/
		BoardController(Views::IBoardView*, Utils::Logging::ILogger* logger,
			Players::Player*, Cards::RoomsCards);

		void perform(); /**< Dokonuje ruchu */
	};
}

